#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void find(int arr[], int sz, int* pn1, int* pn2)
{
	int i = 0;
	int sum = 0;
	for (i = 0; i < sz; i++)
	{
		sum ^= arr[i];
	}

	int pos = 0;
	for (i = 0; i < sz; i++)
	{
		if (sum & (1 << i))
		{
			pos = i;
			break;
		}
	}

	for (i = 0; i < sz; i++)
	{
		if (arr[i] & (1 << pos))
		{
			*pn1 ^= arr[i];
		}
		else
		{
			*pn2 ^= arr[i];
		}
	}
	printf("%d %d\n",*pn1,*pn2);
}
int main()
{
	int arr[] = { 1,2,3,4,5,1,2,3,4,6 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	int n1 = 0;
	int n2 = 0;
	find(arr, sz, &n1, &n2);
	return 0;
}